   <script type="text/javascript">
  function PrintDiv() {    
           var divToPrint = document.getElementById('print');
           var popupWin = window.open('', '_blank', 'width=800,height=800');
           popupWin.document.open();
           popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
            popupWin.document.close();
                }
	</script>			
   
<div align="right">
<input type="button" value="Print" onclick="PrintDiv();"></div>
<div class="row-fluid" id="print">
 <h3 align="center">Purchase Details</h3>  
    <p>Supplier Name: <b><?php echo $supplier['name']; ?></b></p>
	<p>Supplier Email: <b><?php echo $supplier['email']; ?></b></p>
	<p>Supplier Mobile No: <b><?php echo $supplier['mobile']; ?></b></p>
	<p>Referance No: <b><?php echo $referance_no; ?></b></p>
<p align="right"><a href="<?php echo site_url('people/purchaser/create_purchaser');?>"></a></p>
<!--<div id="infoMessage"><?php echo $message;?></div>-->

<table class="table table-striped table-bordered" border="1px" width="100%" >
	
    <tr style="background-color:#F6F6F6;">
		<th>Product name</th>
		<th>Quantity</th>
        <th>Rate</th>
        <th>Amount</th>
        <th>tax</th>
        <th>Discount</th>
		<th>Toatal Price</th>	
	</tr>
   
	<?php foreach ($users as $user):?>
		<tr  style="background-color:#D1E4FC;">
			<td><?php  echo $this->purchase_model->get_product_details($user->id_product); ?></td>
			<td><?php  echo $user->quantity." ".$this->purchase_model->get_unit($user->id_product); ?></td>
            <td><?php  echo $user->rate; ?></td>
            <td><?php  echo $user->amount; ?></td>
			<td><?php  echo $user->tax; ?>%</td>
            <td><?php  echo $user->discount; ?>%</td>
			<td><?php  echo $user->total; ?></td>
		</tr>
	<?php endforeach;?>
</table>
</div>
<!--<p><a href="<?php echo site_url('auth/create_user');?>">Create a new user</a> | <a href="<?php echo site_url('auth/create_group');?>">Create a new group</a>
<a href="<?php echo site_url('auth/logout');?>">Logout</a>
</p>-->
